<%--
  Created by IntelliJ IDEA.
  User: 19538
  Date: 2022/2/11
  Time: 10:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
Index页面

<form action="/login" method="post">
    <input type="text" name="username" placeholder="请输入用户名">
    <input type="password" name="password" placeholder="请输入密码">
    <input type="text" name="captcha" placeholder="请输入验证码">
    <img src="/captcha" onclick="refresh()">
    <input type="submit" value="登录">
</form>
<script>
    function refresh() {
        //根据标签名称获取js组件，返回的是 组件数组
       var img =  document.getElementsByTagName("img")[0];
        img.src = "/captcha?"  + new Date();
    }
</script>
</body>
</html>
